home *** CD-ROM | disk | FTP | other *** search
/ Experimental BBS Explossion 3 / Experimental BBS Explossion III.iso / c / cp1.zip / NOPAUSE1.AS! < prev    next >
Text File  |  1993-03-31  |  4KB  |  113 lines

  1. ===========================================================================
  2.  BBS: The Abacus * HST/DS * Potterville MI
  3. Date: 03-29-93 (17:53)             Number: 41
  4. From: GEOFFREY LIU                 Refer#: NONE
  5.   To: JOEL YEN                      Recvd: NO  
  6. Subj: DISABLE THE PAUSE KEY          Conf: (35) Quick Basi
  7. ---------------------------------------------------------------------------
  8. JY>        Hello! Do anyone know how to disable the PAUSE function of the
  9. JY>keyboard? Please leave a message to me. Thanks a lot.
  10.  
  11.         The following routine doesn't really disable the pause button,
  12. but turns it off 18.2 times every second.
  13.  
  14. 'Stardate: 02-01-93
  15. 'From: EDWARD LAM
  16. 'Conf: NANET-BASIC (44)
  17.  
  18. '   Because B_OnExit might have too many routines registered already, I've made
  19. 'NoPause a function returning TRUE(-1) if everything is ok, otherwise FALSE(0).
  20. '   The B_OnExit routine does look a little eratic to me in the environment but
  21. 'try it and see what happens.
  22.  
  23. 'cut here for NOPDEMO2.BAS
  24.  
  25. 'Example program for NoPause2 module.
  26. '
  27. DECLARE FUNCTION NoPause%
  28. '
  29. CLS
  30. PRINT "Press N for NoPause, U to Unhook NoPause, ESC to exit"
  31. DO
  32.   I = (I + 1) MOD 1000
  33.   LOCATE 5, 5: PRINT "     ";
  34.   LOCATE 5, 5: PRINT I;
  35.   A$ = UCASE$(INKEY$)
  36.   IF A$ = "N" THEN
  37.      IF NOT NoPause% THEN   'We call NoPause here
  38.         LOCATE 2, 1
  39.         PRINT "B_OnExit Full!  Can't stop pause key"
  40.      END IF
  41.   END IF
  42.   IF A$ = "U" THEN
  43.       CALL UnhookNoPause  'Have option to disable nopause from
  44.                                        'within program
  45.       LOCATE 2, 1
  46.       PRINT SPACE$(36)
  47.   END IF
  48. LOOP UNTIL A$ = CHR$(27)
  49. 'Note that we don't care the state of the vectors since B_OnExit will call
  50. 'UnHookNoPause for us.  You can call UnHookExit as many times as you like
  51.  
  52.  ;NoPause2.ASM
  53.  
  54. ;Note that this file has been modified so that the UnHookNoPause routine
  55. ;does not need ever (or should it) to be called.  --EKL
  56.  
  57. EXTRN   B_OnExit:FAR            ;QB's internal routine calls all clean
  58.                                 ;up routines registered with it ony _any_ exit
  59.  
  60. ;
  61. ; NoPause.ASM by Brent Ashley  /  NoPause2.ASM modified by Edward Lam 01/31/93
  62. ;
  63. .model medium, basic
  64. .code
  65. Old1C        Label Dword          ;Label for to old Int 1Ch
  66. Old1COffset  dw ?                 ;Offset part
  67. Old1CSegment dw ?                 ;Segment part
  68. Hooked       db 0                 ;Our installed flag
  69.  
  70. ;Note that if an error occurs registering NoHookPause, NoPause will return
  71. ;FALSE.  Right, it's a function now instead of a sub -- EKL
  72. NoPause proc uses ds dx           ;From BASIC: Ok% = NoPause%
  73.                                   ;Use UnhookNoPause to disable NoPause
  74.  
  75.         cmp cs:Hooked,0           ;Are we already hooked?
  76.         jnz InstallExit           ;If so, exit
  77.  
  78.         ;following section just cut&paste from EVENTCHN.ASM by Jim Mack
  79.         mov     dx, offset UnHookNoPause
  80.         push    cs                ; push far address of UnHookNoPause
  81.         push    dx                ; to register the exit routine
  82.         call    B_OnExit          ; so that we don't hang machine
  83.         or      ax, ax            ; registered OK?
  84.         jz      ErrorExit         ; error: too many registered routines
  85.  
  86.         mov ax,351Ch              ;Get current vector for int 09h
  87.         int 21h
  88.         mov cs:Old1CSegment,es    ;Remember it for later
  89.         mov cs:Old1COffset,bx
  90.         mov ax,251Ch
  91.         push ds
  92.         push cs
  93.         pop ds                    ;Point int 1Ch to our code
  94.         mov dx, offset OurInt1C
  95.         int 21h
  96.         pop ds
  97.         mov cs:Hooked,-1          ;Set our installed flag
  98.         mov ax, -1                ;return TRUE for ok
  99.         jmp InstallExit
  100.  
  101. ErrorExit:
  102.         sub ax, ax                ;put 0 into ax to return with error
  103.  
  104.  
  105. (Continued in the next message)
  106. ---
  107.  * DeLuxe* 1.26b #11507 * Old MacDonald had a computer, with EIA I/O...
  108. --- FidoPCB v1.4 beta
  109.  * Origin: Canada Remote Systems, Mississauga, Ontario  (1:229/15)
  110. SEEN-BY: 1/211 11/2 4 13/13 101/1 108/89 109/25 110/69 114/5 123/19 124/1
  111. SEEN-BY: 153/752 154/40 77 157/2 159/100 125 430 950 203/23 209/209 280/1
  112. SEEN-BY: 390/1 396/1 15 397/2 2230/100 3603/20
  113.